package com.bcinfo.iccard.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.bcinfo.iccard.model.ExpenseRecord;

public interface ExpenseRecordMapper
{
    int deleteByPrimaryKey(Long recordId);

    int insert(ExpenseRecord record);

    int insertSelective(ExpenseRecord record);

    ExpenseRecord selectByPrimaryKey(Long recordId);

    int updateByPrimaryKeySelective(ExpenseRecord record);

    int updateByPrimaryKey(ExpenseRecord record);

    List<ExpenseRecord> selectAllByComboCardSaleId(long comboCardSaleId);

    /**
     * 根据卡号，商家,时间段查询条数 <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-13-下午02:22:44<br/>
     * <p>
     * 
     * @param cardNum
     * @param merchantName
     * @param expensiveStatus
     * @param isAccount
     * @param cardType
     * @param beginTime
     * @param endTime
     * @return
     * 
     */
    int selectCountByCardNum(@Param("cardNum") String cardNum, @Param("merchantName") String merchantName,
            @Param("expensiveStatus") Short expensiveStatus, @Param("isAccount") Short isAccount,
            @Param("cardType") Short cardType, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    /**
     * 根据卡号，商家,时间段查询每页信息 <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-13-下午02:22:22<br/>
     * <p>
     * 
     * @param cardNum
     * @param merchantName
     * @param expensiveStatus
     * @param isAccount
     * @param cardType
     * @param beginTime
     * @param endTime
     * @param benginIndex
     * @param pageSize
     * @return
     * 
     */
    List<ExpenseRecord> selectPageByCardNum(@Param("cardNum") String cardNum,
            @Param("merchantName") String merchantName, @Param("expensiveStatus") Short expensiveStatus,
            @Param("isAccount") Short isAccount, @Param("cardType") Short cardType,
            @Param("beginTime") String beginTime, @Param("endTime") String endTime,
            @Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);

    /**
     * 
     * 商家刷卡记录分页 <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-16-下午10:08:05<br/>
     * <p>
     * 
     * @param merchantId
     * @param cardType
     * @param isAccount
     * @param beginTime
     * @param endTime
     * @param benginIndex
     * @param pageSize
     * @return
     * 
     */
    List<ExpenseRecord> selectByMerchantEncodeByPage(@Param("merchantEncode") String merchantEncode,
            @Param("cardType") Short cardType, @Param("isAccount") Short isAccount,
            @Param("beginTime") String beginTime, @Param("endTime") String endTime,
            @Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);
    
    
    List<ExpenseRecord> selectByMerchantEncodeByDay(@Param("merchantEncode") String merchantEncode,
            @Param("cardType") Short cardType, @Param("isAccount") Short isAccount,
            @Param("beginTime") String beginTime, @Param("endTime") String endTime,
            @Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);

    /**
     * 
     * 统计查看商家刷卡记录<br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-16-下午10:07:15<br/>
     * <p>
     * 
     * @param merchantId
     * @param cardType
     * @param isAccount
     * @param beginTime
     * @param endTime
     * @return
     * 
     */
    int selectCountByMerchantEncode(@Param("merchantEncode") String merchantEncode, @Param("cardType") Short cardType,
            @Param("isAccount") Short isAccount, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    /**
     * 根据商家编码和更新开始时间和更新结束时间查询在游客消费记录表 中 未结算的条数
     * 如果存在的话，不允许进行对商家的 暂不结算 操作
     * 要先进行报表的导出
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-19-下午03:10:00<br/>
     * <p>
     * 
     * @param expensiveStatus
     * @param isAccount
     * @param cardType
     * @param merchantEncode
     * @param beginTime
     * @param endTime
     * @return
     * 
     */
    int selectCountByMerchantAndTime(@Param("expensiveStatus") Short expensiveStatus,
            @Param("isAccount") Short isAccount, @Param("cardType") Short cardType,
            @Param("merchantEncode") String merchantEncode, @Param("beginTime") String beginTime,
            @Param("endTime") String endTime);

}